package com.example.wangzh.developkit.control;

import com.example.wangzh.developkit.R;
import com.example.wangzh.developkit.base.BaseActivity;
import com.example.wangzh.developkit.model.TwoWheelData;
import com.example.wangzh.developkit.model.WheelCity;
import com.example.wangzh.developkit.model.WheelProvince;
import com.example.wangzh.developkit.widget.TwoWheel;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import butterknife.BindView;

/**
 * Created by wangzh on 2017/10/20.
 */

public class WheelPickerActivity extends BaseActivity {
    @BindView(R.id.twoWheel)
    TwoWheel twoWheel;

    @Override
    protected int getLayout() {
        return R.layout.activity_wheel_picker;
    }

    @Override
    protected void initView() {
        twoWheel.setDataList(initDataList());
    }

    private List<TwoWheelData> initDataList() {
        List<TwoWheelData> twoWheelDataList = new ArrayList<>();
        WheelProvince wheelProvince = new WheelProvince("北京市");
        List<WheelCity> wheelCityList = Arrays.asList(
                new WheelCity[]{new WheelCity("东城区"), new WheelCity("西城区"), new WheelCity("朝阳区"),
                        new WheelCity("丰台区"), new WheelCity("石景山区"), new WheelCity("海淀区")}
        );
        twoWheelDataList.add(new TwoWheelData(wheelProvince, wheelCityList));
        WheelProvince wheelProvince2 = new WheelProvince("天津市");
        List<WheelCity> wheelCityList2 = Arrays.asList(
                new WheelCity[]{new WheelCity("和平区"), new WheelCity("河东区"), new WheelCity("河西区"),
                        new WheelCity("南开区"), new WheelCity("河北区")}
        );
        twoWheelDataList.add(new TwoWheelData(wheelProvince2, wheelCityList2));
        WheelProvince wheelProvince3 = new WheelProvince("上海市");
        List<WheelCity> wheelCityList3 = Arrays.asList(
                new WheelCity[]{new WheelCity("黄浦区"), new WheelCity("徐汇区"), new WheelCity("长宁区"),
                        new WheelCity("静安区"), new WheelCity("普陀区")}
        );
        twoWheelDataList.add(new TwoWheelData(wheelProvince3, wheelCityList3));
        WheelProvince wheelProvince4 = new WheelProvince("吉林省");
        List<WheelCity> wheelCityList4 = Arrays.asList(
                new WheelCity[]{new WheelCity("长春市"), new WheelCity("吉林市"), new WheelCity("四平市"),
                        new WheelCity("辽源市"), new WheelCity("通化市")}
        );
        twoWheelDataList.add(new TwoWheelData(wheelProvince4, wheelCityList4));
        WheelProvince wheelProvince5 = new WheelProvince("辽宁省");
        List<WheelCity> wheelCityList5 = Arrays.asList(
                new WheelCity[]{new WheelCity("沈阳市"), new WheelCity("大连市"), new WheelCity("鞍山市"),
                        new WheelCity("抚顺市"), new WheelCity("本溪市"), new WheelCity("丹东市")}
        );
        twoWheelDataList.add(new TwoWheelData(wheelProvince5, wheelCityList5));
        WheelProvince wheelProvince6 = new WheelProvince("河北省");
        List<WheelCity> wheelCityList6 = Arrays.asList(
                new WheelCity[]{new WheelCity("石家庄市"), new WheelCity("唐山市"), new WheelCity("秦皇岛市"),
                        new WheelCity("邯郸市"), new WheelCity("邢台市")}
        );
        twoWheelDataList.add(new TwoWheelData(wheelProvince6, wheelCityList6));
        return twoWheelDataList;
    }

}
